Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix call_ref on empty stack #2472

Merged
merged 1 commit into from
Sep 24, 2024
Merged

Conversation

SoniEx2
Copy link
Contributor

@SoniEx2 SoniEx2 commented Sep 23, 2024

Same issue as #2471 but for call_ref.

We don't believe there's a prior issue for this.

@SoniEx2
Copy link
Contributor Author

SoniEx2 commented Sep 24, 2024

@sbc100

PrintError("%s", message.c_str());
result = Result::Error;
Result result = PeekType(0, &type);
if (!type.IsReferenceWithIndex()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it OK to use type here even if PeekType fails? i.e. should we return early if PeekType fails?

Copy link
Contributor Author

@SoniEx2 SoniEx2 Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this is fine. PeekType will set type to Type::Any, this is the same logic as the fix in #2471 - we want the error message.

@sbc100 sbc100 enabled auto-merge (squash) September 24, 2024 14:52
@SoniEx2
Copy link
Contributor Author

SoniEx2 commented Sep 24, 2024

(you'll have to rebase it)

@SoniEx2
Copy link
Contributor Author

SoniEx2 commented Sep 24, 2024

(actually we'll rebase it)

auto-merge was automatically disabled September 24, 2024 17:29

Head branch was pushed to by a user without write access

@SoniEx2
Copy link
Contributor Author

SoniEx2 commented Sep 24, 2024

(you'll have to re-enable auto-merge tho)

@sbc100 sbc100 merged commit 790bc04 into WebAssembly:main Sep 24, 2024
18 checks passed
@SoniEx2 SoniEx2 deleted the fix-callref-emptystack branch September 24, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants